class Ob:
    def __init__(self, *args, **kwargs):
        self.name = args[0]
        self.items = ["1", "2"]

    def __str__(self):
        return str(self.items)

    def __setitem__(self, index, value):
        self.items[index] = value

    def __mul__(self, num):
        if isinstance(num, int):
            self.items = self.items * num
            return self.items * num
        else:
            TypeError("Unsupported operand type for multiplication")

    def __len__(self):
        return len(self.items)

    def __delitem__(self, index):
        del self.items[index]

    def __hash__(self):
        return hash(self.name)

    def __eq__(self, other):
        if isinstance(other, Ob) and self.name == other.name:
            return self.items
        TypeError("Type is not same")

    def __repr__(self):
        return f'<{self.__class__.__name__} name={self.name} items={self.items}>'


a = Ob('tom')
b = Ob('tom')
print('a: ', a)
a[0] = 'a'
print('a:', a)
a * 3
print('len: ', len(a))
del a[1]
print('a: ', a)
print('set: ', {a, b})

# 其输出如下：
# a: ['1', '2']
# a: ['a', '2']
# len:  6
# a: ['a', 'a', '2', 'a', '2']
# set: {<Ob name=tom items=['a', 'a', '2', 'a', '2']>}
